package com.guochenglang.www.util;

/**
 * @author 郭程朗
 */
public class ObjectTurnKey {
    /**
     * 处理result结果的data，使其转为主键key
     *
     * @param data 需要进行处理的data
     * @return 主键
     */
    public static Integer objectTurnKey(Object[] data) {
        Integer[] ids = new Integer[data.length];
        for (int i = 0; i < data.length; i++) {
            ids[i] = (Integer) data[i];
        }
        return ids[0];
    }

    public static String objectTurnKeyToString(Object[] data) {
        String[] strings = new String[data.length];
        for (int i = 0; i < data.length; i++) {
            strings[i] = (String) data[i];
        }
        return strings[0];
    }
}
